<?php
include("include/config.inc.php");
if(!isset($_SESSION['s_activId']))
{
  $_SESSION['s_urlRedirectDir'] = $_SERVER['REQUEST_URI'];
  header("Location:checkLogin.php");
}
$msg            = "Record Not Found";
$colorArray = array();
$i = 0;
$selectcolorImage = "SELECT subitem.subitemId,item.itemId,size.sizeId,company.companyId,quality.qualityId,
                            color.colorName,item.itemName,size.sizeName,company.companyName,quality.qualityName,
                            subitem.itemImage,design.designId,design.designName
                       FROM subitem
                       LEFT JOIN item ON item.itemId = subitem.itemId
                       LEFT JOIN size ON size.sizeId = subitem.sizeId
                       LEFT JOIN company ON company.companyId = subitem.companyId
                       LEFT JOIN quality ON quality.qualityId = subitem.qualityId
                       LEFT JOIN color ON color.colorId = subitem.colorId
                       LEFT JOIN design ON design.designId = subitem.designId
                      ORDER BY subitemId";
$selectcolorResult = mysql_query($selectcolorImage);
while($colorImageRow = mysql_fetch_array($selectcolorResult))
{
  $colorArray[$i]['subitemId']     = $colorImageRow['subitemId'];
  $colorArray[$i]['colorName']   = $colorImageRow['colorName'];
  $colorArray[$i]['itemId']      = $colorImageRow['itemId'];
  $colorArray[$i]['itemName']    = $colorImageRow['itemName'];
  $colorArray[$i]['sizeId']      = $colorImageRow['sizeId'];
  $colorArray[$i]['sizeName']    = $colorImageRow['sizeName'];
  $colorArray[$i]['companyId']   = $colorImageRow['companyId'];
  $colorArray[$i]['companyName'] = $colorImageRow['companyName'];
  $colorArray[$i]['qualityId']   = $colorImageRow['qualityId'];
  $colorArray[$i]['qualityName'] = $colorImageRow['qualityName'];
  $colorArray[$i]['designName'] = $colorImageRow['designName'];
  $colorArray[$i]['itemImage']   = $colorImageRow['itemImage'];
  $i++;
}
  
include("./bottom.php");
$smarty->assign('colorArray',$colorArray);
$smarty->assign("msg",$msg);
$smarty->display('itemImage.tpl');
?>